package com.maple.soa.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.io.IOException;

/**
 * @author lijian
 * @date 2020/7/13
 */
@Controller
public class RedirectController {

    @RequestMapping("/forward")
    public String forward(Model model, String name) {
        System.out.println(name);
        model.addAttribute("msg", "forward: 转发" + name);

        return "index";
    }

    @RequestMapping("/redirect")
    public String redirect(Model model) throws IOException {
        model.addAttribute("msg", "forward: 转发");

        return "redirect:index.jsp";
    }

}
